Namespace Entities

    Public Class Room
        Implements IDomainEntity

        Protected Sub New()

        End Sub

        Public Sub New(ByVal id As Guid, ByVal name As String)

            Dim cachedDateTime As DateTime = DateTime.Now

            Me.Id = id
            Me.Name = name
            Me.CreatedDate = cachedDateTime
            Me.LastModified = cachedDateTime

        End Sub

        Public Sub New(ByVal name As String)

            Me.New(Guid.NewGuid(), name)

        End Sub

        Private _id As Guid
        Public Overridable Property Id() As System.Guid Implements IDomainEntity.Id
            Get
                Return _id
            End Get
            Set(ByVal value As System.Guid)
                _id = value
            End Set
        End Property

        Private _name As String
        Public Overridable Property Name() As String
            Get
                Return _name
            End Get
            Set(ByVal value As String)
                _name = value
            End Set
        End Property

        Private _createdDate As DateTime

        Public Overridable Property CreatedDate() As Date Implements IDomainEntity.CreatedDate
            Get
                Return _createdDate
            End Get
            Set(ByVal value As Date)
                _createdDate = value
            End Set
        End Property

        Private _lastModified As DateTime
        Public Overridable Property LastModified() As Date Implements IDomainEntity.LastModified
            Get
                Return _lastModified
            End Get
            Set(ByVal value As Date)
                _lastModified = value
            End Set
        End Property

        Private _isDeleted As Boolean
        Public Overridable Property IsDeleted() As Boolean Implements IDomainEntity.IsDeleted
            Get
                Return _isDeleted
            End Get
            Set(ByVal value As Boolean)
                _isDeleted = value
            End Set
        End Property

        Public Overridable Sub Validate() Implements IValidableEntity.Validate

        End Sub

        Public Overridable Sub ValidateDelete() Implements IValidableEntity.ValidateDelete

        End Sub

    End Class

End Namespace
